/* eslint-disable no-nested-ternary */
/* eslint-disable array-callback-return */
import React from 'react';
import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import {
  Card,
  Col,
  Row,
  Divider,
  Spin,
  message,
  InputNumber,
  Button,
  Table,
  Input,
  Select,
  DatePicker,
  Radio,
  Switch,
  Cascader,
  Modal,
} from 'antd';
import moment from 'moment';
import router from 'umi/router';

import { connect } from 'dva';

import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import FooterToolbar from '@/components/FooterToolbar';
import { matchDict, urlParse } from '@/utils/utils';
import styles from '@/utils/utils.less';

import DictCode from '../../components/DictCode';

const FormItem = Form.Item;
const { Option } = Select;
const RadioGroup = Radio.Group;
const { MonthPicker } = DatePicker;
const { TextArea } = Input;
@connect(({ addempupdate, loading, publicdata }) => ({
  loading: loading.models.addempupdate,
  addempupdate,
  dictCode: publicdata.dictCode,
}))
@Form.create()
class BasicForm extends React.Component {
  state = {
    sendId: '',
    addTaskId: '',
    taskSource: '1',
    sendDraftId: '',
    costCenterList: [], // 成本中心
    payEmpClassifyList: [], // 缴费人员类别
    isBaseInfoFlag: false,
    baseInfoDto: {
      entryDate: null,
      areaId: '',
      custId: '',
      quoId: '',
      insCityId: '',
      accuCityId: '',
    },
    laborCont: {},    // 合同信息
    // isChrgFlag: false, // 是否修改收费年月
    isCostCenterFlag: false, // 是否修改成本中心
    insIdeFlag: true, // 是否显示缴费人员类别
    insIdeUpdateFlag: true, // 是否可修改缴费人员类别
    isInsIdeFlag: false, // 是否修改缴费人员类别
    isPactFlag: false, // 是否显示修改合同信息
    sendContUpdateFlag: false, // 是否可修改合同信息
    insIdeBefore: undefined,
    // isProbFlag: false, // 是否可修改业务开始日期
    isSendBeginDateFlag: false, // 是否修改业务开始日期
    insDecWageFlag: true, // 是否显示社保申报工资
    insDecWageUpdateFlag: true, // 是否可修改社保申报工资
    isInsDecWageFlag: false, // 是否修改社保申报工资
    insDecWageBefore: 0, // 社保申报工资
    accuDecWageFlag: true, // 是否显示公积金申报工资
    accuDecWageBefore: 0, // 公积金申报工资
    accuDecWageUpdateFlag: true, // 是否可修改公积金申报工资
    isAccuDecWageFlag: false, // 是否修改公积金申报工资
    insLsPkgFlag: true, // 是否显示社保组合
    insLsPkgUpdateFlag: true, // 是否可修改社保组合
    isInsLsPkgFlag: false, // 是否修改社保组合
    accuLsPkgFlag: true, // 是否显示公积金组合
    accuLsPkgUpdateFlag: true, // 是否可修改社保组合
    isAccuLsPkgFlag: false, // 是否修改社保组合
    // chrgBeginDateBefore: '', // 收费开始年月
    costCenter: '', // 成本中心
    sendBeginDateUpdateFlag: true, // 是否可修改业务开始日期
    sendBeginDateBefore: '', // 业务开始日期
    pdSetFlag: '2', // 是否打开产品分项设置
    assSetFlag: '2', // 是否打开险种分项设置
    insDecWageSetFlag: '2', // 是否打开险种分项设置工资
    insSetFlag: '1', // 五险是否合一:1合 2不合一
    insWageList: [], // 险种分项列表
    pdBeginDateList: [], // 产品分项数据源
    oldPdBeginDateList: [], // 产品分项数据源(接口原数据)
    assBeginDateList: [], // 险种分项设置数据源
    oldAssBeginDateList: [], // 险种分项设置数据源(接口原数据)
    insSerConfigFlag: '2', // 社保组合是否使用服务配置
    insPayWayList: [], // 社保缴费方式
    accuPayWayList: [], // 公积金缴费方式
    accuSerConfigFlag: '2', // 公积金是否使用服务配置
    serConfigList: [], // 服务配置 ：社保
    accuSerConfigList: [], // 服务配置:公积金
    isHasSerAcco: false, // 有无工伤险种
    secAccoList: [], // 工伤二级户列表
    insGroupData: [], // 社保组合数据
    accuGroupData: [], // 公积金组合数
    insAccountList: [], // 社保单立户账户数据
    accuAccountList: [], // 公积金单立户账户数据
    insSingleAccout: '1', // 社保:选择单立户
    accuSingleAccout: '1', // 公积金:选择单立户
    insGroupList: [], // 社保组合列表
    accuGroupList: [], // 公积金组合列表
    secAccoName: '', // 工伤二级户账户名称
    isEdit: true, // 是否有更改信息
    insLsPkgDtoList: [],
    accuLsPkgDto: {},
    isSupplyRun: false, // 是否是供应商执行
    subite: true, // 分项设置
    dateflg: false,
    isRemark: false,
    insPdOldDate: new Date(),
  };

  componentDidMount() {
    const { dispatch, location } = this.props;
    const { sendId = null, addTaskId = null, taskSource = '1' } = urlParse(location.search);
    this.setState({ sendId, addTaskId, taskSource });
    dispatch({
      type: 'publicdata/fetchDictCode',
      payload: [
        'ADD_ID_TYPE',
        'GENDER',
        'PAY_FEES_WAY',
        'EXECUTE_POWER_TYPE',
        'CONT_SIGN_WAY',
        'EMP_CONT_TYPE',
        'WORK_HOURS',
        'YES_NO_FLAG',
        'PD_CATE',
        'BIZ_INS_TYPE',
        'BIZ_ACCU_TYPE',
        'NATIONALITY',
        'ORGANIZATION',
        'MRTL_STATUS',
        'POL_STATUS',
        'HOUSEHOLD_TYPE',
      ],
    }).then(dictCode => {
      if (dictCode) {
        // 获取详情信息
        dispatch({
          type: 'addempupdate/fetchDetail',
          payload: { addTaskId, dictCode },
        }).then(res => {
          if (res.success && res.data) {
            let isSupplyRun = true;
            let insPdOldDate = new Date();
            if (res.data.pdBeginDateList) {
              const sortNumber = (a, b) => a.pdCate - b.pdCate;
              res.data.pdBeginDateList = res.data.pdBeginDateList.sort(sortNumber);
              res.data.pdBeginDateList.forEach(item => {
                if (item.pdId === 'PDINF_0000000001') {
                  isSupplyRun = item.execType === 2;
                  insPdOldDate = item.sendBeginDateBefore;
                }
              });
              this.setState({ oldPdBeginDateList: res.data.pdBeginDateList, insPdOldDate });
            }
            if (res.data.assBeginDateList) {
              // 产品分项的
              const sortNumber = (a, b) => b.ass - a.ass;
              if (res.data.insSetFlag === 1) {
                // 五险合一
                let sendBeginDateBefore = null;
                const insDateArr = [];
                res.data.assBeginDateList.map(item => {
                  if (item !== '2') {
                    // eslint-disable-next-line prefer-destructuring
                    sendBeginDateBefore = item.sendBeginDateBefore;
                    insDateArr.push(item.isProbFlag);
                  }
                });
                const isInsUpdate = insDateArr.some(item => item.isProbFlag);
                res.data.assBeginDateList = res.data.assBeginDateList.filter(
                  item => `${item.ass}` === '1'
                );
                res.data.assBeginDateList.unshift({
                  ass: 1,
                  assName: '社保',
                  isProbFlag: isInsUpdate,
                  sendBeginDateBefore,
                });
              } else {
                // 险种中过滤公积金的数据
                res.data.assBeginDateList = res.data.assBeginDateList.filter(
                  item => `${item.ass}` !== '2'
                );
                res.data.assBeginDateList = res.data.assBeginDateList.sort(sortNumber);
              }
              this.setState({ oldAssBeginDateList: res.data.assBeginDateList });
            }
            if (res.data.insLsPkgDtoList) {
              // 社保账户
              const sortNumber = (a, b) => b.ass - a.ass;
              if (res.data.insSetFlag === 1) {
                // 五险合一
                const insLsPkgDtoList = [];
                insLsPkgDtoList.push({
                  ass: 1,
                  assName: '社保',
                  grpName: res.data.insLsPkgDtoList[0].grpName,
                  isProbFlag: res.data.insLsPkgDtoList[0].isProbFlag,
                  payWay: res.data.insLsPkgDtoList[0].payWay,
                  payWayName: res.data.insLsPkgDtoList[0].payWayName,
                });
                res.data.insLsPkgDtoList = insLsPkgDtoList;
              } else {
                res.data.insLsPkgDtoList = res.data.insLsPkgDtoList.sort(sortNumber);
              }
            }
            if (res.data.insPayWayList) {
              const newInsPayWayList = [];
              if (dictCode.PAY_FEES_WAY.length) {
                // 缴费方式
                res.data.insPayWayList.forEach(l => {
                  newInsPayWayList.push({
                    itemCode: l,
                    itemName: matchDict(dictCode.PAY_FEES_WAY, l),
                  });
                });
              }
              res.data.insPayWayList = newInsPayWayList;
            }
            if (res.data.accuPayWayList) {
              const newAccuPayWayList = [];
              if (dictCode.PAY_FEES_WAY.length) {
                // 缴费方式
                res.data.accuPayWayList.forEach(l => {
                  newAccuPayWayList.push({
                    itemCode: l,
                    itemName: matchDict(dictCode.PAY_FEES_WAY, l),
                  });
                });
              }
              res.data.accuPayWayList = newAccuPayWayList;
            }
            if (res.data.insLsPkgDtoList) {
              // 判断有无工伤险
              const isHasSerAcco = res.data.insLsPkgDtoList.some(item => `${item.ass}` === '5');
              this.setState({ isHasSerAcco });
            }
            this.setState({
              ...res.data,
              insSetFlag: `${res.data.insSetFlag || 1}`,
              insDecWageSetFlag: res.data.insSetFlag === 2 ? '1' : '2',
              insWageList: res.data.insWageList || [],
              isSupplyRun,
            });
            // 所属成本中心
            dispatch({
              type: 'addempupdate/getCostCenter',
              payload: { custId: res.data.baseInfoDto && res.data.baseInfoDto.custId },
            }).then(r => {
              if (r.success && r.data.length) {
                this.setState({ costCenterList: r.data });
              }
            });
            dispatch({
              type: 'addempupdate/updateModelData',
              payload: {
                isContEndRequired: res.data && res.data.laborCont &&+res.data.laborCont.fixedDeadlnFlag === 1,
              },
            });
            dispatch({
              type: 'addempupdate/updateModelData',
              payload: {
                isTryDateRequired: res.data && res.data.laborCont && +res.data.laborCont.probtnFlag === 1 ,
              },
            });
            this.isEditInfo();
          } else {
            Modal.warning({
              title: res.message || '获取详情数据出错！',
              okText: '知道了',
              onOk: () => {
                router.push(`/customservicemanage/addemployee/index`);
              },
            });
          }
        });
      }
    });
  }

  // 获取缴费人员类别（参保身份）：
  getHouseTypeList = () => {
    const { dispatch } = this.props;
    const { baseInfoDto } = this.state;
    dispatch({
      type: 'addempupdate/getInsIdeList',
      payload: { areaId: baseInfoDto.insCityId },
    }).then(res => {
      if (res.success && res.data.length) {
        this.setState({ payEmpClassifyList: res.data });
      } else {
        this.setState({ payEmpClassifyList: [] });
        message.warning(`${res.message || '暂无缴费人员类别数据！'}`);
      }
    });
  };

  // switch按钮开关控制
  changeSWitch = (checked, id) => {
    const { form } = this.props;
    const { pdSetFlag, subite } = this.state;
    this.setState({ [id]: checked }, () => {
      this.isEditInfo();
    });
    if (checked) {
      // 打开修改
      const { baseInfoDto, insLsPkgDtoList } = this.state;
      if (id === 'isInsIdeFlag') {
        // 缴费人员列表
        this.getHouseTypeList(baseInfoDto.insCityId);
      }
      if (id === 'isInsLsPkgFlag') {
        // 社保组合
        this.setInsGroupData(insLsPkgDtoList);
        this.setState({ insSingleAccout: '1' });
      }
      if (id === 'isAccuLsPkgFlag') {
        // 公积金组合
        this.setAccuGroupData();
        this.setState({ accuSingleAccout: '1' });
      }
      if (id === 'isBaseInfoFlag') {
        Object.keys(baseInfoDto).forEach(key => {
          if (!baseInfoDto[key]) {
            baseInfoDto[key] = '';
          }
          if (baseInfoDto[key]) {
            if (
              key === 'polStatus' ||
              key === 'mrtlStatus' ||
              key === 'nat' ||
              key === 'hshdRegType' ||
              key === 'addConEmpFlag'
            ) {
              baseInfoDto[key] = `${baseInfoDto[key]}`;
              form.setFieldsValue({ [`baseInfoDto.${key}`]: { key: baseInfoDto[key] } });
            }
            if (key === 'entryDate') {
              form.setFieldsValue({
                [`baseInfoDto.${key}`]: moment(baseInfoDto.entryDate),
              });
            } else if (key === 'mobile' || key === 'email' || key === 'householdAddr') {
              form.setFieldsValue({ [`baseInfoDto.${key}`]: `${baseInfoDto[key]}` });
            }
          }
        });
      }
    } else {
      // 关闭修改
      if (id === 'isInsLsPkgFlag') {
        this.setState({ insSerConfigFlag: '2' });
      }
      if (id === 'isAccuLsPkgFlag') {
        this.setState({ accuSerConfigFlag: '2' });
      }
      if (id === 'isBaseInfoFlag') {
        form.resetFields([`baseInfoDto.mobile`]);
      }
      if (id === 'isSendBeginDateFlag') {
        if (pdSetFlag === '1') {
          this.setState({ pdSetFlag: '2' });
        }
        if (!subite) {
          this.setState({ subite: true }, () => {
            this.cancelItemSetting();
          });
        }
      }
    }
  };

  // 选择业务开始日期
  selectBeginDate = (date, dateString, id, pdOrAssId) => {
    // const { pdSetFlag, assSetFlag } = this.state;
    if (!id) {
      this.setState({ sendBeginDateBefore: dateString }, () => {
        // if (pdSetFlag === '1') {
        //   this.setPdOrAssData(date, 'pdSetFlag', null, true);
        // }
        // if (assSetFlag === '1') {
        //   this.setPdOrAssData(date, 'assSetFlag', null, true);
        // }
      });
    } else {
      this.setPdOrAssData(date, id, pdOrAssId);
    }
  };

  // 单选按钮控制：打开产品分项设置,服务配置等
  changeRadio = (e, id, isSetDate) => {
    const { form } = this.props;
    const { insLsPkgDtoList } = this.state;
    const sendBeginDate = form.getFieldValue('sendBeginDateBefore');
    this.setState({ [id]: e.target.value }, () => {
      if (e.target.value === '1') {
        if (isSetDate && sendBeginDate) {
          // 设置业务开始日期
          this.setPdOrAssData(sendBeginDate, id, null, true);
        }
        if (id === 'insSerConfigFlag') {
          // 服务配置：社保
          this.setInsGroupData(insLsPkgDtoList);
          this.getSerConfigList(1);
        }
        if (id === 'accuSerConfigFlag') {
          // 服务配置：公积金
          this.getSerConfigList(2);
        }
      } else if (id === 'insSerConfigFlag') {
        // 选择否：工伤二级户隐藏
        this.setState({ insSingleAccout: '1', secAccoName: '' });
      }
    });
  };

  // 设置产品、险种分项设置数据
  setPdOrAssData = (sendBeginDate, id, pdOrAssId, isFirst) => {
    const {
      pdBeginDateList,
      assBeginDateList,
      oldAssBeginDateList,
      oldPdBeginDateList,
      subite,
    } = this.state;
    const { form } = this.props;
    if (!pdOrAssId) {
      // 上方总设置业务开始日期
      if (id === 'pdSetFlag') {
        // 产品分项设置
        pdBeginDateList.map(item => {
          const temp = item;
          if (isFirst) {
            oldPdBeginDateList.map(o => {
              if (o.pdId === item.pdId) {
                form.setFieldsValue({
                  [`sendBeginDate_pd_${item.pdId}`]: moment(o.sendBeginDateBefore),
                });
                temp.sendBeginDate = moment(o.sendBeginDateBefore).format('YYYY-MM-01');
              }
            });
          } else if (item.isProbFlag) {
            form.setFieldsValue({
              [`sendBeginDate_pd_${item.pdId}`]: sendBeginDate,
            });
            temp.sendBeginDate = moment(sendBeginDate).format('YYYY-MM-01');
          }
        });
      }
      if (id === 'assSetFlag') {
        // 险种分项设置
        assBeginDateList.map(item => {
          const tempValue = item;
          if (isFirst) {
            oldAssBeginDateList.map(o => {
              if (`${o.ass}` === `${item.ass}`) {
                form.setFieldsValue({
                  [`sendBeginDate_ass_${item.ass}`]: moment(o.sendBeginDateBefore),
                });
                tempValue.sendBeginDate = moment(o.sendBeginDateBefore).format('YYYY-MM-01');
              }
            });
          } else if (item.isProbFlag) {
            form.setFieldsValue({ [`sendBeginDate_ass_${item.ass}`]: sendBeginDate });
            tempValue.sendBeginDate = moment(sendBeginDate).format('YYYY-MM-01');
          }
        });
      }
      this.setState({ pdBeginDateList, assBeginDateList }, () => {
        if (id === 'pdSetFlag' && !subite) {
          this.cancelItemSetting();
        }
      });
    } else {
      // 分项设置业务开始日期
      if (id === 'pdSetFlag') {
        // 产品分项设置
        pdBeginDateList.map(item => {
          const temps = item;
          if (item.pdId === pdOrAssId) {
            temps.sendBeginDate = moment(sendBeginDate).format('YYYY-MM-01');
          }
        });
        // 险种分项设置
        assBeginDateList.map(items => {
          const valueAccept = items;
          if (items.pdId === pdOrAssId) {
            valueAccept.sendBeginDate = moment(sendBeginDate).format('YYYY-MM-01');
          }
        });
      }
      if (id === 'assSetFlag') {
        // 险种分项设置
        assBeginDateList.map(item => {
          const tempList = item;
          if (item.ass === pdOrAssId) {
            tempList.sendBeginDate = moment(sendBeginDate).format('YYYY-MM-01');
          }
        });
      }
      this.setState({ pdBeginDateList, assBeginDateList });
    }
  };

  // 限制时间
  disabledDate = (current, id) => {
    const { form } = this.props;
    if (!id) {
      return current < moment().subtract(1, 'months') || current > moment().add(3, 'months');
    }
    const startDate = form.getFieldValue(id);
    if (!startDate) {
      return false;
    }
    return current < moment(startDate).endOf('day');
  };

  // 获取服务配置列表
  getSerConfigList = insOrAccu => {
    // insOrAccu :1是社保  2是公积金
    const { dispatch } = this.props;
    const { insSetFlag, insLsPkgDtoList, baseInfoDto } = this.state;
    const { custId, quoId, insCityId, accuCityId } = baseInfoDto;
    const kindList = [];
    if (insCityId && insOrAccu === 1) {
      if (insSetFlag === '1') {
        // 五险合一
        kindList.push({
          areaId: insCityId,
          kind: 1,
        });
      } else {
        insLsPkgDtoList.forEach(item => {
          kindList.push({
            areaId: insCityId,
            kind: item.ass,
          });
        });
      }
    } else if (accuCityId && insOrAccu === 2) {
      kindList.push({
        areaId: accuCityId,
        kind: 2,
      });
    }
    dispatch({
      type: 'addempupdate/getSerConfigList',
      payload: { kindList, custId, quoId },
    }).then(res => {
      if (res.success) {
        if (insOrAccu === 2) {
          this.setState({ accuSerConfigList: res.data });
        } else {
          this.setState({ serConfigList: res.data });
        }
      } else if (insOrAccu === 2) {
        this.setState({ accuSerConfigList: [] });
      } else {
        this.setState({ serConfigList: [] });
      }
    });
  };

  // 选择服务配置
  selectSerConfig = (value, options, id) => {
    let serConfigInfo = options.props.serconinfo;
    if (id === 'ins') {
      // 社保组合
      serConfigInfo = serConfigInfo.filter(item => item.ass !== 2);
      this.setInsGroupData(serConfigInfo);
    } else {
      // 公积金组合
      const accuGroupData = [];
      serConfigInfo = serConfigInfo.filter(item => `${item.ass}` === '2');
      serConfigInfo.map(item => {
        accuGroupData.push({
          ass: item.ass,
          assName: item.assName,
          payWayName: item.payWayName,
          accoName: item.accoName,
          grpName: item.grpName,
        });
      });
      this.setState({ accuGroupData });
    }
  };

  // 设置社保组合数据源:数据源，缴费方式，账户名称，社保组合，工伤二级户名称
  setInsGroupData = (dataSourse, payWayName, accoName, grpName, secAccoName) => {
    // console.log('参数', dataSourse, '缴费方式:', payWayName, '账户名称:', accoName, '社保组合:', grpName, '工伤二级户名称:', secAccoName)
    const { insSetFlag } = this.state;
    const insGroupData = [];
    if (insSetFlag === '2') {
      // 五险不合一
      dataSourse.map(item => {
        insGroupData.push({
          ass: item.ass,
          assName: item.assName,
          payWayName: item.isProbFlag
            ? payWayName === undefined
              ? item.payWayName
              : payWayName
            : item.payWayName,
          accoName: item.isProbFlag
            ? accoName === undefined
              ? item.accoName
              : accoName
            : item.accoName,
          grpName: item.isProbFlag
            ? grpName === undefined
              ? item.grpName
              : grpName
            : item.grpName,
          isProbFlag: item.isProbFlag,
        });
      });
    } else {
      // 五险合一
      // eslint-disable-next-line no-param-reassign
      dataSourse = dataSourse.filter(item => `${item.ass}` === '2' || `${item.ass}` === '1');
      dataSourse.map(item => {
        insGroupData.push({
          ass: item.ass,
          assName: item.assName,
          payWayName: item.isProbFlag
            ? payWayName === undefined
              ? item.payWayName
              : payWayName
            : item.payWayName,
          accoName: item.isProbFlag
            ? accoName === undefined
              ? item.accoName
              : accoName
            : item.accoName,
          grpName: item.isProbFlag
            ? grpName === undefined
              ? item.grpName
              : grpName
            : item.grpName,
          isProbFlag: item.isProbFlag,
        });
      });
    }
    if (secAccoName) {
      // 工伤二级户入口
      insGroupData.map(item => {
        const temp = item;
        if (`${item.ass}` === '5' && item.isProbFlag) {
          temp.accoName = secAccoName;
        }
      });
    }
    this.setState({ insGroupData });
  };

  // 设置公积金组合数据源
  setAccuGroupData = (payWayName, accoName, grpName) => {
    const { accuLsPkgDto } = this.state;
    const accuGroupData = [];
    accuGroupData.push({
      ass: accuLsPkgDto.ass,
      assName: accuLsPkgDto.assName,
      payWayName: accuLsPkgDto.isProbFlag
        ? payWayName === undefined
          ? accuLsPkgDto.payWayName
          : payWayName
        : accuLsPkgDto.payWayName,
      accoName: accuLsPkgDto.isProbFlag
        ? accoName === undefined
          ? accuLsPkgDto.accoName
          : accoName
        : accuLsPkgDto.accoName,
      grpName: accuLsPkgDto.isProbFlag
        ? grpName === undefined
          ? accuLsPkgDto.grpName
          : grpName
        : accuLsPkgDto.grpName,
      isProbFlag: accuLsPkgDto.isProbFlag,
    });
    this.setState({ accuGroupData });
  };

  // 选择缴费方式
  selectPayWay = (value, id) => {
    this.setState({ [id]: value.key });
    const { form } = this.props;
    const {
      insAccountList,
      insLsPkgDtoList,
      isHasSerAcco,
      secAccoName,
      accuAccountList,
      baseInfoDto,
      isSupplyRun,
    } = this.state;
    if (id === 'insSingleAccout') {
      if (value.key === '1') {
        // 单立户：渲染表格数据
        const insAccoId = form.getFieldValue('insAccoId');
        let accoName = '';
        if (insAccoId) {
          // eslint-disable-next-line no-shadow
          const id = insAccoId.key;
          insAccountList.map(item => {
            if (item.accoId === id) {
              accoName = item.plcyName;
            }
          });
        }
        this.setInsGroupData(
          insLsPkgDtoList,
          value.label,
          insAccoId ? insAccoId.label : '',
          insAccoId ? accoName : ''
        );
      }
      if (value.key === '2') {
        // 大库
        this.getInsAccuGroupList('insGroupList', 'PDINF_0000000001'); // 获取单立户下拉列表
        if (isHasSerAcco && baseInfoDto.areaId === '1415662' && !isSupplyRun) {
          // 获取工伤二级户
          this.getSecAccoList();
        }
        const grpId = form.getFieldValue('insGrpId'); // 渲染表格数据
        this.setInsGroupData(
          insLsPkgDtoList,
          value.label,
          '',
          grpId ? grpId.label : '',
          secAccoName
        );
      }
    }
    if (id === 'accuSingleAccout') {
      // 公积金
      if (value.key === '1') {
        // 单立户：渲染表格数据
        const accuAccoId = form.getFieldValue('accuAccoId');
        let accoName = '';
        if (accuAccoId) {
          // eslint-disable-next-line no-shadow
          const id = accuAccoId.key;
          accuAccountList.map(item => {
            if (item.accoId === id) {
              accoName = item.plcyName;
            }
          });
        }
        this.setAccuGroupData(
          value.label,
          accuAccoId ? accuAccoId.label : '',
          accuAccoId ? accoName : ''
        );
      }
      if (value.key === '2') {
        // 大库
        this.getInsAccuGroupList('accuGroupList', 'PDINF_0000000002');
        const grpId = form.getFieldValue('accuGrpId'); // 渲染表格数据
        this.setAccuGroupData(value.label, '', grpId ? grpId.label : '');
      }
    }
  };

  // 获取单立户账户列表
  getAccountList = pdId => {
    const { dispatch } = this.props;
    const { baseInfoDto } = this.state;
    const { insCityId, accuCityId, custId } = baseInfoDto;
    dispatch({
      type: 'addempupdate/getAccountList',
      payload: { areaId: pdId === 'PDINF_0000000001' ? insCityId : accuCityId, custId, pdId },
    }).then(res => {
      if (res.success && res.data.length) {
        if (pdId === 'PDINF_0000000001') {
          this.setState({ insAccountList: res.data });
        } else {
          this.setState({ accuAccountList: res.data });
        }
      } else if (pdId === 'PDINF_0000000001') {
        this.setState({ insAccountList: [] });
      } else {
        this.setState({ accuAccountList: [] });
      }
    });
  };

  // 获取社保组合、公积金组合列表
  getInsAccuGroupList = (id, pdId) => {
    const { dispatch } = this.props;
    const { baseInfoDto } = this.state;
    const { insCityId, accuCityId, custId } = baseInfoDto;
    const { insSetFlag, insLsPkgDtoList } = this.state;
    let insKinds = [];
    if (insCityId && pdId === 'PDINF_0000000001') {
      if (insSetFlag === '1') {
        // 五险合一
        insKinds = ['3', '4', '5', '6', '7'];
      } else {
        insLsPkgDtoList.forEach(item => {
          insKinds.push(item.ass);
        });
      }
    }
    const params =
      pdId === 'PDINF_0000000001'
        ? { areaId: pdId === 'PDINF_0000000001' ? insCityId : accuCityId, pdId, custId, insKinds }
        : {
            areaId: pdId === 'PDINF_0000000001' ? insCityId : accuCityId,
            pdId,
            custId,
          };
    dispatch({
      type: 'addempupdate/getInsAccuGroupList',
      payload: params,
    }).then(res => {
      if (res.success) {
        this.setState({ [id]: res.data });
      } else {
        this.setState({ [id]: [] });
      }
    });
  };

  // 获取工伤二级户列表
  getSecAccoList = () => {
    const { form, dispatch } = this.props;
    const { baseInfoDto } = this.state;
    const { custId } = baseInfoDto;
    dispatch({
      type: 'addempupdate/getSecAccoList',
      payload: { custId, areaId: '1415662', payWay: '2', insKinds: '5' },
    }).then(res => {
      if (res.success && res.data && res.data.length) {
        res.data.map(item => {
          const temp = item;
          temp.value = item.accoId;
          temp.label = item.accoName;
          temp.isLeaf = !item.injSecAccoDtos;
          if (item.injSecAccoDtos) {
            const children = [];
            item.injSecAccoDtos.map(it => {
              children.push({
                value: it.injSecAccoId,
                label: it.injSecAccoName,
                isLeaf: true,
              });
            });
            temp.children = children;
          }
          const secAccuList = res.data;
          let secAccuIntValue;
          if (
            secAccuList.length === 1 &&
            secAccuList[0].injSecAccoDtos &&
            secAccuList[0].injSecAccoDtos.length === 1
          ) {
            secAccuIntValue = [
              secAccuList[0].accoId,
              secAccuList[0].injSecAccoDtos[0].injSecAccoId,
            ];
            form.setFieldsValue({ injSecAccoId: secAccuIntValue });
          }
          this.setState({ secAccoList: secAccuList });
        });
      } else {
        message.warning('该地区下未维护工伤二级户数据！');
      }
    });
  };

  // 选择工伤二级户
  selectSecAcco = (value, selectedOptions) => {
    const { insLsPkgDtoList } = this.state;
    const { form } = this.props;
    let accoName = '';
    selectedOptions.map((item, index) => {
      accoName += (index > 0 ? '/' : '') + item.label;
    });

    accoName = accoName.trim();
    this.setState({ secAccoName: accoName });
    this.setInsGroupData(
      insLsPkgDtoList,
      form.getFieldValue('insPayWay') ? form.getFieldValue('insPayWay').label : '',
      '',
      value.label,
      accoName
    );
  };

  // 监听是否有更改信息
  isEditInfo = () => {
    const { form } = this.props;
    const { isBaseInfoFlag, isRemark } = this.state;
    const switchFieldValue = form.getFieldValue([
      'isChrgFlag',
      'isCostCenterFlag',
      'isAccuDecWageFlag',
      'isAccuLsPkgFlag',
      'isInsDecWageFlag',
      'isInsDecWageFlag',
      'isInsIdeFlag',
      'isPactFlag',
      'isInsLsPkgFlag',
      'isSendBeginDateFlag',
    ]);

    // eslint-disable-next-line compat/compat
    const switchValueList = [...Object.values(switchFieldValue), isBaseInfoFlag, isRemark] || [];
    this.setState({ isEdit: switchValueList.some(item => item) });
  };

  // 分项设置*****
  itemSetting = () => {
    const { form } = this.props;
    const { pdBeginDateList, assBeginDateList } = this.state;
    this.setState({ subite: false, assSetFlag: '1' });
    const dataList = JSON.parse(JSON.stringify(pdBeginDateList));
    let i = 0;
    dataList.forEach((item, index) => {
      if (item.pdId === 'PDINF_0000000001') {
        // 社保
        i = index;
        assBeginDateList.map(value => {
          const temp = value;
          temp.pdId = value.ass;
          temp.pdCateName = value.assName;
          temp.sendBeginDate = moment(value.sendBeginDateBefore).format('YYYY-MM-01');
        });
        dataList.splice(i + 1, 0, ...assBeginDateList);
        this.setState({ dateflg: true }, () => {
          // eslint-disable-next-line no-shadow
          dataList.forEach(item => {
            if (item.pdId === 'PDINF_0000000001') {
              assBeginDateList.forEach(value => {
                form.setFieldsValue({
                  [`sendBeginDate_pd_${value.pdId}`]: moment(value.sendBeginDateBefore),
                });
              });
            }
          });
        });
      }
    });
    this.setState({ pdBeginDateList: dataList });
  };

  // 取消分项设置****
  cancelItemSetting = () => {
    const { form } = this.props;
    const { pdBeginDateList, assBeginDateList, insPdOldDate } = this.state;
    this.setState({ subite: true, dateflg: false, assSetFlag: '2' });
    const arr = JSON.parse(JSON.stringify(pdBeginDateList));
    let i = 0;
    arr.forEach((item, index) => {
      if (item.pdId === 'PDINF_0000000001') {
        // 社保
        i = index;
        // eslint-disable-next-line no-param-reassign
        item.sendBeginDate = moment(insPdOldDate).format('YYYY-MM-01');
        form.setFieldsValue({
          [`sendBeginDate_pd_${item.pdId}`]: moment(insPdOldDate),
        });
        arr.splice(i + 1, assBeginDateList.length); // 将五险的数据截取掉
      }
    });
    this.setState({ pdBeginDateList: arr });
  };

  // 更改办理备注
  changeRemark = e => {
    e.persist();
    this.setState({ isRemark: e.target.value && e.target.value.trim().length > 0 }, () => {
      this.isEditInfo();
    });
  };

  // 提交数据
  sumSubmit = e => {
    const { form, dispatch } = this.props;
    e.preventDefault();
    const {
      sendId,
      addTaskId,
      sendDraftId,
      isBaseInfoFlag,
      insSetFlag,
      isSendBeginDateFlag,
      pdBeginDateList,
      assBeginDateList,
      insLsPkgDtoList,
      accuLsPkgDto,
      insWageList,
      insDecWageSetFlag,
      isInsDecWageFlag,
      assSetFlag,
      sendContUpdateFlag,
      laborCont
    } = this.state;
    let submitData = {};
    form.validateFieldsAndScroll((err, values) => {
      if (!err) {
        const temp = values;
        Object.keys(values).forEach(key => {
          if (values[key] === '' || values[key] === undefined || values[key] === null) {
            // 不存在
            temp[key] = '';
          } else if (key === 'baseInfoDto') {
            // 基本信息
            const obj = values[key];
            Object.keys(obj).forEach(k => {
              if (!obj[k]) {
                obj[k] = '';
              } else if (
                obj[k].key &&
                (obj[k].key === '' || obj[k].key === undefined || obj[k].key == null)
              ) {
                obj[k] = '';
              } else if (obj[k].key) {
                obj[k] = obj[k].key;
              } else if (k === 'entryDate') {
                obj[k] = obj[k].format('YYYY-MM-DD');
              }
            });
          } else if (values[key].key) {
            // 下拉
            temp[key] = values[key].key;
          } else if (key === 'chrgBeginDateBefore' || key === 'sendBeginDateBefore') {
            // 年月
            temp[key] = values[key].format('YYYY-MM-01');
          }
          if (key === 'sendBeginDateBefore' && values[key] && values.pdSetFlag === '1') {
            pdBeginDateList.map(item => {
              delete temp[`sendBeginDate_pd_${item.pdId}`];
            });
          }
          delete temp.pdSetTable;
          delete temp.insSetTable;
          delete temp.insGroupTable;
          delete temp.accuGroupTable;
          if (key === 'sendBeginDateBefore' && values[key] && values.assSetFlag === '1') {
            assBeginDateList.map(item => {
              temp[key] = values[key];
              delete temp[`sendBeginDate_ass_${item.ass}`];
            });
          }
          if(key === 'laborCont') {
            // signDate  contBeginDate contEndDate  probtnBeginDate probtnEndDate 
            // 合同信息
            const obj = values[key];
            Object.keys(obj).forEach(k => {
              if (!obj[k]) {
                obj[k] = '';
              } else if (
                obj[k].key &&
                (obj[k].key === '' || obj[k].key === undefined || obj[k].key == null)
              ) {
                obj[k] = '';
              } else if (obj[k].key) {
                obj[k] = obj[k].key;
              } else if (k === 'entryDate' || k === 'contBeginDate' || k === 'contEndDate' || k === 'probtnBeginDate' || k === 'probtnEndDate' || k==='signDate') {
                obj[k] = obj[k].format('YYYY-MM-DD');
              }
              if(k === 'electrSignFlag') {
                obj[k] = +obj[k]
              }
            });
            obj.laborContId = laborCont.laborContId
          }
          // laborCont: {...laborCont, electrSignFlag: +laborCont.electrSignFlag},

        });

        if (!isBaseInfoFlag) {
          delete temp.baseInfoDto;
        }
        const newPdBeginDateList = [];
        pdBeginDateList.map(itemtime => {
          const itemtimeTemp = itemtime;
          itemtimeTemp.sendBeginDateBefore = moment(itemtime.sendBeginDateBefore).format(
            'YYYY-MM-01'
          );
          if (!itemtime.ass) {
            newPdBeginDateList.push(itemtime);
          }
        });
        assBeginDateList.map(itemtime => {
          const itemtimes = itemtime;
          itemtimes.sendBeginDateBefore = moment(itemtime.sendBeginDateBefore).format('YYYY-MM-01');
        });
        if (insSetFlag === '1') {
          temp.assSetFlag = '2';
        } else if (insSetFlag === '2' && insDecWageSetFlag === '1' && isInsDecWageFlag) {
          const insDecWageList = [];
          // 五险不合一

          insWageList.map(item => {
            insDecWageList.push({
              ass: item.ass,
              insDecWage: values.insDecWageDto[`wage_${item.ass}`],
            });
          });
          delete temp.insDecWageDto;
          temp.insDecWageList = insDecWageList;
          
        }
        submitData = isSendBeginDateFlag
          ? {
              ...values,
              isBaseInfoFlag,
              pdBeginDateList: newPdBeginDateList,
              assBeginDateList,
              sendId,
              addTaskId,
              sendDraftId,
              insSetFlag,
              insLsPkgDtoList,
              accuLsPkgDto,
              insDecWageSetFlag,
              assSetFlag,
              isContUpdateFlag: sendContUpdateFlag,
            }
          : {
              ...values,
              isBaseInfoFlag,
              sendId,
              addTaskId,
              sendDraftId,
              insSetFlag,
              insLsPkgDtoList,
              accuLsPkgDto,
              insDecWageSetFlag,
              assSetFlag,
              isContUpdateFlag: sendContUpdateFlag,
            };
            console.log(submitData);
        dispatch({
          type: 'addempupdate/submit',
          payload: submitData,
        }).then(res => {
          if (res.success) {
            message.success(`${res.message || '修改成功！'}`, 3, () => {
              // 有优雅判断路由的方式请联系我 del1214@gmail.com
              const effectPathname = '/customservicemanage/addemployee/update';
              if (this?.props?.history.location.pathname === effectPathname) {
                router.push(`/customservicemanage/addemployee/index`);
              }
            });
          } else {
            message.warning(`${res.message || '修改失败！'}`);
          }
        });
      }
    });
  };

  // 选择有无试用期
  selectContTryDate = value => {
    const { form, dispatch } = this.props

    dispatch({
      type: 'addempupdate/updateModelData',
      payload: {
        isTryDateRequired: value === '1',
      },
    });

    form.setFieldsValue({
      laborCont:{
        probtnFlag: value,
        probtnBeginDate: null,
        probtnEndDate: null,
        probtnWage: null,
      }
    })

  };

  // 有无固定期限
  selectContFixedDate = value => {
    const {
      dispatch, form
    } = this.props;
    // const {laborCont} = this.state
    dispatch({
      type: 'addempupdate/updateModelData',
      payload: {
        isContEndRequired: value === '1',
      },
    });
    
    form.setFieldsValue({
      laborCont:{
        // ...laborCont,
        fixedDeadlnFlag: value,
        contEndDate: null,
      }
    })
  };

  // 限制时间
  disabledEndDate = (current, id) => {
    const { form } = this.props;
    const startDate = form.getFieldValue(id);
    if (!startDate) {
      return false;
    }
    return current < moment(startDate).endOf('day');
  };

  // 限制开始时间
  disabledStarDate = (current, id) => {
    const { form } = this.props;
    const startDate = form.getFieldValue(id);
    console.log(startDate);
    if (!startDate) {
      return false;
    }
    return (current + 8.64e7) > moment(startDate).endOf('day');
  };

  render() {
    const {
      isBaseInfoFlag,
      baseInfoDto,
      laborCont, // 合同信息
      costCenterList,
      payEmpClassifyList,
      insGroupData,
      accuGroupData,
      serConfigList,
      accuSerConfigList,
      secAccoList,
      // isChrgFlag, // 是否修改收费年月
      isCostCenterFlag, // 是否修改成本中心 
      insIdeFlag, // 是否显示缴费人员类别
      insIdeUpdateFlag, // 是否可修改缴费人员类别
      isInsIdeFlag, // 是否修改缴费人员类别
      isPactFlag, // 是否显示合同信息
      sendContUpdateFlag, // 是否可修改合同信息
      // isProbFlag, // 是否可修改业务开始日期
      isSendBeginDateFlag, // 是否修改业务开始日期
      insDecWageFlag, // 是否显示社保申报工资
      insDecWageUpdateFlag, // 是否可修改社保申报工资
      isInsDecWageFlag, // 是否修改社保申报工资
      insDecWageBefore,
      accuDecWageFlag, // 是否显示公积金申报工资
      accuDecWageUpdateFlag, // 是否可修改公积金申报工资
      isAccuDecWageFlag, // 是否修改公积金申报工资
      accuDecWageBefore,
      insLsPkgFlag, // 是否显示社保组合
      insLsPkgUpdateFlag, // 是否可修改社保组合
      isInsLsPkgFlag, // 是否修改社保组合
      accuLsPkgFlag, // 是否显示公积金组合
      accuLsPkgUpdateFlag, // 是否可修改公积金组合
      isAccuLsPkgFlag, // 是否修改公积金组合
      // chrgBeginDateBefore,
      costCenter,
      sendBeginDateBefore,
      pdSetFlag,
      // assSetFlag,
      // insDecWageSetFlag,
      pdBeginDateList,
      assBeginDateList,
      insSerConfigFlag,
      accuSerConfigFlag,
      insPayWayList,
      accuPayWayList,
      insAccountList,
      accuAccountList,
      insIdeBefore,
      insSingleAccout,
      accuSingleAccout,
      insGroupList,
      accuGroupList,
      isHasSerAcco,
      insLsPkgDtoList,
      secAccoName,
      isEdit,
      insSetFlag,
      sendBeginDateUpdateFlag,
      insWageList,
      isSupplyRun,
      taskSource,
      dateflg,
      subite,
    } = this.state;
    const {
      form,
      dictCode: { YES_NO_FLAG },
      loading,
      addempupdate: { isContEndRequired, isTryDateRequired  },
      
    } = this.props;
    console.log(isContEndRequired,"isContEndRequired");
    const { getFieldDecorator } = form;
    const pdColumns = [
      {
        title: '产品',
        dataIndex: 'pdCateName',
        width: 150,
        align: 'center',
      },
      {
        title: '业务开始日期',
        dataIndex: 'sendBeginDate',
        width: 200,
        render: (text, record) => (
          <div>
            <FormItem style={{ margin: 0, width: 180 }}>
              {getFieldDecorator(`sendBeginDate_pd_${record.pdId}`, {
                rules: [{ required: true, message: '请选择' }],
              })(
                <MonthPicker
                  style={{ width: '110%' }}
                  placeholder="请选择"
                  format="YYYY-MM-01"
                  allowClear={false}
                  onChange={(date, dateString) =>
                    this.selectBeginDate(date, dateString, 'pdSetFlag', record.pdId)
                  }
                  disabled={
                    !!(
                      (record.pdId === 'PDINF_0000000001' && dateflg === true) ||
                      !record.isProbFlag
                    )
                  }
                />
              )}
            </FormItem>
            {insSetFlag === '2' &&
            record.pdId === 'PDINF_0000000001' &&
            assBeginDateList.length > 0 ? (
              subite === true ? (
                <a
                  style={{ lineHeight: '40px', marginLeft: '20px' }}
                  onClick={() => {
                    this.itemSetting(record);
                  }}
                >
                  分项设置
                </a>
              ) : (
                <a
                  style={{ lineHeight: '40px', marginLeft: '20px' }}
                  onClick={() => {
                    this.cancelItemSetting();
                  }}
                >
                  取消分项设置
                </a>
              )
            ) : null}
          </div>
        ),
      },
    ];
    // const assColumns = [
    //   {
    //     title: '险种',
    //     dataIndex: 'assName',
    //     width: 150,
    //     align: 'center',
    //   },
    //   {
    //     title: '业务开始日期',
    //     dataIndex: 'sendBeginDate',
    //     width: 150,
    //     align: 'center',
    //     render: (text, record) => (
    //       <FormItem style={{ margin: 0 }}>
    //         {getFieldDecorator(`sendBeginDate_ass_${record.ass}`, {
    //           rules: [{ required: true, message: '请选择' }],
    //         })(
    //           <MonthPicker
    //             placeholder="请选择"
    //             format="YYYY-MM-01"
    //             allowClear={false}
    //             onChange={(date, dateString) =>
    //               this.selectBeginDate(date, dateString, 'assSetFlag', record.ass)
    //             }
    //             disabled={!record.isProbFlag}
    //           />
    //         )}
    //       </FormItem>
    //     ),
    //   },
    // ];
    const insGroupColumns = [
      {
        title: '险种',
        dataIndex: 'assName',
        width: 150,
        align: 'center',
      },
      {
        title: '缴费方式',
        dataIndex: 'payWayName',
        width: 150,
        align: 'center',
      },
      {
        title: '缴费账户',
        dataIndex: 'accoName',
        width: 150,
        align: 'center',
      },
      {
        title: '社保组合',
        dataIndex: 'grpName',
        width: 150,
        align: 'center',
        render: text => <a>{text}</a>,
      },
    ];
    const accuGroupColumns = [
      {
        title: '险种',
        dataIndex: 'assName',
        width: 150,
        align: 'center',
      },
      {
        title: '缴费方式',
        dataIndex: 'payWayName',
        width: 150,
        align: 'center',
      },
      {
        title: '缴费账户',
        dataIndex: 'accoName',
        width: 150,
        align: 'center',
      },
      {
        title: '公积金组合',
        dataIndex: 'grpName',
        width: 150,
        align: 'center',
        render: text => <a>{text}</a>,
      },
    ];
    const formItemLayout = {
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 13 },
      },
    };
    const formItemLayoutRemark = {
      labelCol: {
        xs: { span: 24 },
        sm: { span: 1 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 23 },
      },
    };
    // 字典下拉
    const dictOL = dictList =>
      dictList.map(options => <Option key={options.itemCode}>{options.itemName}</Option>);
    // 成本中心
    const costCenterOL = costCenterList.map(options => (
      <Option key={options.costCenterId}>{options.name}</Option>
    ));
    // 缴费人员类别
    const payEmpClassifyOL = payEmpClassifyList.map(options => (
      <Option key={options.ideId}>{options.ideName}</Option>
    ));
    // 服务配置：社保
    const serConfigOL = serConfigList.map(options => (
      <Option key={options.custConfId} serconinfo={options.confDetList}>
        {options.custConfNo}
      </Option>
    ));
    // 服务配置:公积金
    const accuSerConfigOL = accuSerConfigList.map(options => (
      <Option key={options.custConfId} serconinfo={options.confDetList}>
        {options.custConfNo}
      </Option>
    ));
    // 单立户账户：社保
    const insAccountOL = insAccountList.map(options => (
      <Option key={options.accoId} serconinfo={options}>
        {options.accoName}
      </Option>
    ));
    // 单立户账户：公积金
    const accuAccountOL = accuAccountList.map(options => (
      <Option key={options.accoId} serconinfo={options}>
        {options.accoName}
      </Option>
    ));
    // 社保组合
    const insGroupOL = insGroupList.map(options => (
      <Option key={options.lsPkgId} serconinfo={options}>
        {options.lsPkgName}
      </Option>
    ));
    // 公积金组合
    const accuGroupOL = accuGroupList.map(options => (
      <Option key={options.lsPkgId} serconinfo={options}>
        {options.lsPkgName}
      </Option>
    ));
    
    return (
      <PageHeaderWrapper>
        <Spin tip="Loading..." spinning={loading}>
          <Form layout="inline" className={styles.addempUpdateStyle}>
            {taskSource === '1' && (
              <Card
                title={
                  <div>
                    <span
                      style={{ fontWeight: 'bolder', verticalAlign: 'middle', marginRight: 20 }}
                    >
                      基本信息
                    </span>
                    <Switch
                      checkedChildren="修改"
                      unCheckedChildren="不修改"
                      onChange={check => this.changeSWitch(check, 'isBaseInfoFlag')}
                    />
                  </div>
                }
              >
                <Row>
                  <Col md={8} style={{ height: '48px', lineHeight: '48px' }}>
                    <span style={{ color: 'rgba(0,0,0,.85)' }}>客户名称：</span>
                    {baseInfoDto.custName}
                  </Col>
                  <Col md={8} style={{ height: '48px', lineHeight: '48px' }}>
                    <span style={{ color: 'rgba(0,0,0,.85)' }}>商务合同：</span>
                    {baseInfoDto.custContName}
                  </Col>
                  <Col md={8} style={{ height: '48px', lineHeight: '48px' }}>
                    <span style={{ color: 'rgba(0,0,0,.85)' }}>报价单：</span>
                    {baseInfoDto.quoName}
                  </Col>
                  <Col md={8} style={{ height: '48px', lineHeight: '48px' }}>
                    <span style={{ color: 'rgba(0,0,0,.85)' }}>姓名：</span>
                    {baseInfoDto.empName}
                  </Col>
                  <Col md={8} style={{ height: '48px', lineHeight: '48px' }}>
                    <span style={{ color: 'rgba(0,0,0,.85)' }}>证件类型：</span>
                    {baseInfoDto.idTypeName}
                  </Col>
                  <Col md={8} style={{ height: '48px', lineHeight: '48px' }}>
                    <span style={{ color: 'rgba(0,0,0,.85)' }}>证件号：</span>
                    {baseInfoDto.idCode}
                  </Col>
                  <Col md={8} style={{ height: '48px', lineHeight: '48px' }}>
                    <span style={{ color: 'rgba(0,0,0,.85)' }}>国籍：</span>
                    {baseInfoDto.nationName}
                  </Col>
                  <Col md={8} style={{ height: '48px', lineHeight: '48px' }}>
                    <span style={{ color: 'rgba(0,0,0,.85)' }}>出生日期：</span>
                    {baseInfoDto.birthDate
                      ? moment(baseInfoDto.birthDate).format('YYYY-MM-DD')
                      : '无'}
                  </Col>
                  <Col md={8} style={{ height: '48px', lineHeight: '48px' }}>
                    <span style={{ color: 'rgba(0,0,0,.85)' }}>性别：</span>
                    {baseInfoDto.genderName}
                  </Col>
                  <Col md={8}>
                    <FormItem
                      label={
                        <span
                          style={{
                            display: 'inline-block',
                            width: isBaseInfoFlag ? 45 : 'auto',
                            textAlign: isBaseInfoFlag ? 'justify' : 'left',
                            textAlignLast: isBaseInfoFlag ? 'justify' : 'left',
                          }}
                        >
                          手机
                        </span>
                      }
                      style={{ width: '100%' }}
                    >
                      {getFieldDecorator('baseInfoDto.mobile', {
                        rules: [
                          {
                            required: isBaseInfoFlag,
                            message: '请输入11位手机号码',
                            pattern: /^1(3|4|5|6|7|8|9)\d{9}$/,
                          },
                        ],
                      })(
                        isBaseInfoFlag ? (
                          <Input placeholder="请输入" maxLength={12} style={{ width: 200 }} />
                        ) : (
                          <span>{baseInfoDto.mobile}</span>
                        )
                      )}
                    </FormItem>
                  </Col>
                  <Col md={8}>
                    <FormItem
                      label={<span style={{ display: 'inline-block' }}>员工邮箱</span>}
                      style={{ width: '100%' }}
                    >
                      {getFieldDecorator('baseInfoDto.email', {
                        rules: [{ required: false, type: 'email', message: '应为邮箱格式' }],
                      })(
                        isBaseInfoFlag ? (
                          <Input placeholder="请输入" maxLength={50} style={{ width: 200 }} />
                        ) : (
                          <span>{baseInfoDto.email}</span>
                        )
                      )}
                    </FormItem>
                  </Col>
                  <Col md={8}>
                    <FormItem
                      label={<span style={{ display: 'inline-block' }}>入职日期</span>}
                      style={{ width: '100%' }}
                    >
                      {getFieldDecorator('baseInfoDto.entryDate', {
                        rules: [{ required: isBaseInfoFlag, message: '请选择' }],
                      })(
                        isBaseInfoFlag ? (
                          <DatePicker
                            allowClear={false}
                            placeholder="请选择"
                            style={{ width: 188 }}
                          />
                        ) : (
                          <span>
                            {baseInfoDto.entryDate
                              ? moment(baseInfoDto.entryDate).format('YYYY-MM-DD')
                              : null}
                          </span>
                        )
                      )}
                    </FormItem>
                  </Col>
                  <Col md={8}>
                    <FormItem
                      label={<span style={{ display: 'inline-block' }}>是否员工联系</span>}
                      style={{ width: '100%' }}
                    >
                      {getFieldDecorator('baseInfoDto.addConEmpFlag', {
                        rules: [{ required: isBaseInfoFlag, message: '请选择' }],
                      })(
                        isBaseInfoFlag ? (
                          <Select
                            placeholder="请选择"
                            style={{ width: 160 }}
                            labelInValue
                            showSearch
                            optionFilterProp="children"
                          >
                            {dictOL(YES_NO_FLAG)}
                          </Select>
                        ) : (
                          <span>{baseInfoDto.addConEmpFlagName}</span>
                        )
                      )}
                    </FormItem>
                  </Col>
                </Row>
              </Card>
            )}

            {taskSource === '1' && (
              <Card title={<span style={{ fontWeight: 'bolder' }}>收费信息</span>}>
                {/* <Row>
                <Col offset={2}>
                  <FormItem
                    label={
                      <span style={{ display: 'inline-block', width: 108 }}>收费开始年月</span>
                    }
                    colon={false}
                    style={{ marginLeft: 30 }}
                  >
                    {getFieldDecorator('isChrgFlag', {
                      valuePropName: 'checked',
                      rules: [{ required: false, message: '请选择' }],
                      initialValue: false,
                    })(
                      <Switch
                        checkedChildren="修改"
                        unCheckedChildren="不修改"
                        style={{ width: 70 }}
                        onChange={check => this.changeSWitch(check, 'isChrgFlag')}
                      />
                    )}
                  </FormItem>
                  {isChrgFlag ? (
                    <FormItem label="收费开始年月" style={{ width: '100%' }} {...formItemLayout}>
                      {getFieldDecorator('chrgBeginDateBefore', {
                        rules: [{ required: true, message: '请选择' }],
                        initialValue: moment(chrgBeginDateBefore, 'YYYY-MM-01'),
                      })(
                        <MonthPicker
                          placeholder="请选择"
                          allowClear={false}
                          disabledDate={this.disabledDate}
                          style={{ width: 600 }}
                        />
                      )}
                    </FormItem>
                  ) : null}
                </Col>
              </Row>
              <Divider dashed style={{ marginBottom: 14 }} /> */}
                <Row>
                  <Col offset={2}>
                    <FormItem
                      label={<span style={{ display: 'inline-block', width: 108 }}>成本中心</span>}
                      colon={false}
                      style={{ marginLeft: 30 }}
                    >
                      {getFieldDecorator('isCostCenterFlag', {
                        valuePropName: 'checked',
                        rules: [{ required: false, message: '请选择' }],
                        initialValue: false,
                      })(
                        <Switch
                          checkedChildren="修改"
                          unCheckedChildren="不修改"
                          style={{ width: 70 }}
                          onChange={check => this.changeSWitch(check, 'isCostCenterFlag')}
                        />
                      )}
                    </FormItem>
                    {isCostCenterFlag ? (
                      <FormItem
                        label="成本中心"
                        style={{ width: '100%', marginLeft: 140 }}
                        {...formItemLayout}
                      >
                        {getFieldDecorator('costCenter', {
                          rules: [{ required: false, message: '请选择' }],
                          initialValue: { key: costCenter || '' },
                        })(
                          <Select
                            placeholder="请选择"
                            allowClear
                            labelInValue
                            showSearch
                            optionFilterProp="children"
                            style={{ width: 600 }}
                          >
                            {costCenterOL}
                          </Select>
                        )}
                      </FormItem>
                    ) : null}
                  </Col>
                </Row>
              </Card>
            )}
            <Card
              className={styles.labelStyleRight}
              title={<span style={{ fontWeight: 'bolder' }}>申报信息</span>}
            >
              {insIdeFlag ? (
                <div>
                  <Row>
                    <Col offset={2}>
                      <FormItem
                        label={
                          <span style={{ display: 'inline-block', width: 108 }}>缴费人员类别</span>
                        }
                        colon={false}
                        style={{ marginLeft: 30 }}
                      >
                        {getFieldDecorator('isInsIdeFlag', {
                          valuePropName: 'checked',
                          rules: [{ required: false, message: '请选择' }],
                          initialValue: false,
                        })(
                          <Switch
                            checkedChildren="修改"
                            unCheckedChildren="不修改"
                            style={{ width: 70 }}
                            onChange={check => this.changeSWitch(check, 'isInsIdeFlag')}
                            disabled={!insIdeUpdateFlag}
                          />
                        )}
                      </FormItem>
                      {isInsIdeFlag && insIdeUpdateFlag ? (
                        <FormItem
                          label="缴费人员类别"
                          style={{ width: '100%', marginLeft: 140 }}
                          {...formItemLayout}
                        >
                          {getFieldDecorator('insIdeBefore', {
                            rules: [{ required: true, message: '请选择' }],
                            initialValue: insIdeBefore && { key: insIdeBefore },
                          })(
                            <Select
                              placeholder="请选择"
                              labelInValue
                              showSearch
                              optionFilterProp="children"
                              style={{ width: 600 }}
                            >
                              {payEmpClassifyOL}
                            </Select>
                          )}
                        </FormItem>
                      ) : null}
                    </Col>
                  </Row>
                  <Divider dashed style={{ marginBottom: 14 }} />
                </div>
              ) : null}
              <Row>
                <Col offset={2}>
                  <FormItem
                    label={
                      <span style={{ display: 'inline-block', width: 108 }}>业务开始日期</span>
                    }
                    colon={false}
                    style={{ marginLeft: 30, marginBottom: 10 }}
                  >
                    {getFieldDecorator('isSendBeginDateFlag', {
                      valuePropName: 'checked',
                      rules: [{ required: false, message: '请选择' }],
                      initialValue: false,
                    })(
                      <Switch
                        checkedChildren="修改"
                        unCheckedChildren="不修改"
                        style={{ width: 70 }}
                        onChange={check => this.changeSWitch(check, 'isSendBeginDateFlag')}
                        disabled={!sendBeginDateUpdateFlag}
                      />
                    )}
                  </FormItem>
                  {isSendBeginDateFlag ? (
                    <div style={{ marginLeft: 140 }}>
                      <FormItem
                        label="业务开始日期"
                        style={{ width: '100%', marginBottom: 10 }}
                        {...formItemLayout}
                      >
                        {getFieldDecorator('sendBeginDateBefore', {
                          rules: [{ required: true, message: '请选择' }],
                          initialValue: moment(sendBeginDateBefore),
                        })(
                          <MonthPicker
                            placeholder="请选择"
                            format="YYYY-MM-01"
                            style={{ width: 600 }}
                            allowClear={false}
                            onChange={this.selectBeginDate}
                          />
                        )}
                      </FormItem>
                      <FormItem
                        label="设置产品分项"
                        style={{ width: '100%', marginBottom: 10 }}
                        {...formItemLayout}
                      >
                        {getFieldDecorator('pdSetFlag', {
                          rules: [{ required: true, message: '请选择' }],
                          initialValue: pdSetFlag,
                        })(
                          <RadioGroup onChange={e => this.changeRadio(e, 'pdSetFlag', true)}>
                            {YES_NO_FLAG.map(item => (
                              <Radio key={item.itemCode} value={item.itemCode}>
                                {item.itemName}
                              </Radio>
                            ))}
                          </RadioGroup>
                        )}
                      </FormItem>
                      {pdSetFlag === '1' ? (
                        <FormItem
                          label="&nbsp;"
                          style={{ width: '100%', marginBottom: 10 }}
                          colon={false}
                          {...formItemLayout}
                        >
                          {getFieldDecorator('pdSetTable', {
                            rules: [{ required: false, message: '请选择' }],
                          })(
                            <div style={{ position: 'relative', marginLeft: '45px' }}>
                              <Table
                                style={{ width: 550 }}
                                columns={pdColumns}
                                dataSource={pdBeginDateList}
                                rowKey={record => record.pdId}
                                bordered
                                size="middle"
                                pagination={false}
                              />
                              {insSetFlag === '2' && (
                                <span
                                  style={{
                                    position: 'absolute',
                                    display: 'inline-block',
                                    width: 200,
                                    left: 580,
                                    top: '-7px',
                                    color: '#999',
                                    lineHeight: '25px',
                                  }}
                                >
                                  说明：
                                  <br />
                                  产品分项设置主要设置各项服务费的业务开始日期，如果险种未分项设置，则险种的业务开始日期按照产品分项设置修改。
                                </span>
                              )}
                            </div>
                          )}
                        </FormItem>
                      ) : null}
                      {/* {insSetFlag === '1' ? null : (
                        <FormItem
                          label="设置险种分项"
                          style={{ width: '100%', marginBottom: 10 }}
                          {...formItemLayout}
                        >
                          {getFieldDecorator('assSetFlag', {
                            rules: [{ required: true, message: '请选择' }],
                            initialValue: assSetFlag,
                          })(
                            <RadioGroup onChange={e => this.changeRadio(e, 'assSetFlag', true)}>
                              {YES_NO_FLAG.map(item => (
                                <Radio key={item.itemCode} value={item.itemCode}>
                                  {item.itemName}
                                </Radio>
                              ))}
                            </RadioGroup>
                          )}
                        </FormItem>
                      )} */}
                      {/* {assSetFlag === '1' ? (
                        <FormItem
                          label="&nbsp;"
                          style={{ width: '100%', marginBottom: 10 }}
                          colon={false}
                          {...formItemLayout}
                        >
                          {getFieldDecorator('insSetTable', {
                            rules: [{ required: false, message: '请选择' }],
                          })(
                            <div style={{ position: 'relative', marginLeft: '-50px' }}>
                              <Table
                                style={{ width: 550 }}
                                columns={assColumns}
                                dataSource={assBeginDateList}
                                rowKey={record => record.ass}
                                bordered
                                size="middle"
                                pagination={false}
                              />
                              <span
                                style={{
                                  position: 'absolute',
                                  display: 'inline-block',
                                  width: 200,
                                  left: 580,
                                  top: '-7px',
                                  color: '#999',
                                  lineHeight: '25px',
                                }}
                              >
                                说明：
                                <br />
                                险种分项设置只设置各险种的业务开始日期。
                              </span>
                            </div>
                          )}
                        </FormItem>
                      ) : null} */}
                    </div>
                  ) : null}
                </Col>
              </Row>
              {insDecWageFlag ? (
                <div>
                  <Divider dashed style={{ marginBottom: 14 }} />
                  <Row>
                    <Col offset={2}>
                      <FormItem
                        label={
                          <span style={{ display: 'inline-block', width: 108 }}>社保申报工资</span>
                        }
                        colon={false}
                        style={{ marginLeft: 30, marginBottom: 10 }}
                      >
                        {getFieldDecorator('isInsDecWageFlag', {
                          valuePropName: 'checked',
                          rules: [{ required: false, message: '请选择' }],
                          initialValue: false,
                        })(
                          <Switch
                            checkedChildren="修改"
                            unCheckedChildren="不修改"
                            style={{ width: 70 }}
                            onChange={check => this.changeSWitch(check, 'isInsDecWageFlag')}
                            disabled={!insDecWageUpdateFlag}
                          />
                        )}
                      </FormItem>
                      {isInsDecWageFlag && insDecWageUpdateFlag && insSetFlag === '1' ? (
                        <FormItem
                          label="社保申报工资"
                          style={{ width: '100%', marginBottom: 10, marginLeft: 140 }}
                          {...formItemLayout}
                        >
                          {getFieldDecorator('insDecWageDto.insDecWage', {
                            rules: [
                              {
                                required: true,
                                message: '请输入小数点不超过2位的数字',
                                pattern: /^-?\d+\.?\d{0,2}$/,
                              },
                            ],
                            initialValue: insDecWageBefore,
                          })(
                            <InputNumber
                              min={0}
                              max={9999999.99}
                              placeholder="请输入"
                              style={{ width: 600 }}
                            />
                          )}
                        </FormItem>
                      ) : null}
                      {/* {isInsDecWageFlag && insDecWageUpdateFlag && insSetFlag === '2' && (
                        <FormItem
                          label="分险种维护"
                          style={{ width: '100%', marginBottom: 10 }}
                          {...formItemLayout}
                        >
                          {getFieldDecorator('insDecWageSetFlag', {
                            rules: [{ required: true, message: '请选择' }],
                            initialValue: insDecWageSetFlag,
                          })(
                            <RadioGroup onChange={e => this.changeRadio(e, 'insDecWageSetFlag')}>
                              {YES_NO_FLAG.map(item => (
                                <Radio key={item.itemCode} value={item.itemCode}>
                                  {item.itemName}
                                </Radio>
                              ))}
                            </RadioGroup>
                          )}
                        </FormItem>
                      )} */}
                      {isInsDecWageFlag &&
                        insDecWageUpdateFlag &&
                        insSetFlag === '2' &&
                        insWageList.map(item => (
                          <FormItem
                            key={item.ass}
                            label={`${item.assName}申报工资`}
                            style={{ width: '100%', marginBottom: 10, marginLeft: 140 }}
                            {...formItemLayout}
                          >
                            {getFieldDecorator(`insDecWageDto.wage_${item.ass}`, {
                              rules: [
                                {
                                  required: true,
                                  message: '请输入小数点不超过2位的数字',
                                  pattern: /^-?\d+\.?\d{0,2}$/,
                                },
                              ],
                              initialValue: item.wage,
                            })(
                              <InputNumber
                                min={0}
                                max={9999999.99}
                                placeholder="请输入"
                                style={{ width: 600 }}
                                disabled={!item.probFlag}
                              />
                            )}
                          </FormItem>
                        ))}
                    </Col>
                  </Row>
                </div>
              ) : null}
              {accuDecWageFlag ? (
                <div>
                  <Divider dashed style={{ marginBottom: 14 }} />
                  <Row>
                    <Col offset={2}>
                      <FormItem
                        label={
                          <span style={{ display: 'inline-block', width: 108 }}>
                            公积金申报工资
                          </span>
                        }
                        colon={false}
                        style={{ marginLeft: 30, marginBottom: 10 }}
                      >
                        {getFieldDecorator('isAccuDecWageFlag', {
                          valuePropName: 'checked',
                          rules: [{ required: false, message: '请选择' }],
                          initialValue: false,
                        })(
                          <Switch
                            checkedChildren="修改"
                            unCheckedChildren="不修改"
                            style={{ width: 70 }}
                            onChange={check => this.changeSWitch(check, 'isAccuDecWageFlag')}
                            disabled={!accuDecWageUpdateFlag}
                          />
                        )}
                      </FormItem>
                      {isAccuDecWageFlag && accuDecWageUpdateFlag ? (
                        <FormItem
                          label="公积金申报工资"
                          style={{ width: '100%', marginBottom: 10, marginLeft: 140 }}
                          {...formItemLayout}
                        >
                          {getFieldDecorator('accuDecWageBefore', {
                            rules: [
                              {
                                required: true,
                                message: '请输入小数点不超过2位的数字',
                                pattern: /^-?\d+\.?\d{0,2}$/,
                              },
                            ],
                            initialValue: accuDecWageBefore,
                          })(
                            <InputNumber
                              min={0}
                              max={9999999.99}
                              placeholder="请输入"
                              style={{ width: 600 }}
                            />
                          )}
                        </FormItem>
                      ) : null}
                    </Col>
                  </Row>
                </div>
              ) : null}
              {insLsPkgFlag ? (
                <div>
                  <Divider dashed style={{ marginBottom: 14 }} />
                  <Row>
                    <Col offset={2}>
                      <FormItem
                        label={
                          <span style={{ display: 'inline-block', width: 108 }}>社保组合</span>
                        }
                        colon={false}
                        style={{ marginLeft: 30, marginBottom: 10 }}
                      >
                        {getFieldDecorator('isInsLsPkgFlag', {
                          valuePropName: 'checked',
                          rules: [{ required: false, message: '请选择' }],
                          initialValue: false,
                        })(
                          <Switch
                            checkedChildren="修改"
                            unCheckedChildren="不修改"
                            style={{ width: 70 }}
                            onChange={check => this.changeSWitch(check, 'isInsLsPkgFlag')}
                            disabled={!insLsPkgUpdateFlag}
                          />
                        )}
                      </FormItem>
                      {isInsLsPkgFlag && insLsPkgUpdateFlag ? (
                        <div style={{ marginLeft: 140 }}>
                          <FormItem
                            label="服务配置"
                            style={{ width: '100%', marginBottom: 10 }}
                            {...formItemLayout}
                          >
                            {getFieldDecorator('insSerConfigFlag', {
                              rules: [{ required: true, message: '请选择' }],
                              initialValue: insSerConfigFlag,
                            })(
                              <RadioGroup
                                onChange={e => this.changeRadio(e, 'insSerConfigFlag', false)}
                              >
                                {YES_NO_FLAG.map(item => (
                                  <Radio key={item.itemCode} value={item.itemCode}>
                                    {item.itemName}
                                  </Radio>
                                ))}
                              </RadioGroup>
                            )}
                          </FormItem>
                          {insSerConfigFlag === '1' ? (
                            <FormItem
                              label="使用服务配置"
                              style={{ width: '100%', marginBottom: 10 }}
                              {...formItemLayout}
                            >
                              {getFieldDecorator('insSerSetId', {
                                rules: [{ required: true, message: '请选择' }],
                              })(
                                <Select
                                  placeholder="请选择"
                                  labelInValue
                                  showSearch
                                  optionFilterProp="children"
                                  style={{ width: 600 }}
                                  onSelect={(value, options) =>
                                    this.selectSerConfig(value, options, 'ins')
                                  }
                                >
                                  {serConfigOL}
                                </Select>
                              )}
                            </FormItem>
                          ) : null}
                          {insSerConfigFlag === '2' ? (
                            <div>
                              <FormItem
                                label="缴费方式"
                                style={{ width: '100%', marginBottom: 10 }}
                                {...formItemLayout}
                              >
                                {getFieldDecorator('insPayWay', {
                                  rules: [{ required: true, message: '请选择' }],
                                })(
                                  <Select
                                    placeholder="请选择"
                                    labelInValue
                                    showSearch
                                    optionFilterProp="children"
                                    style={{ width: 600 }}
                                    onSelect={value => this.selectPayWay(value, 'insSingleAccout')}
                                  >
                                    {dictOL(insPayWayList)}
                                  </Select>
                                )}
                              </FormItem>
                              {insSingleAccout === '1' ? (
                                <FormItem
                                  label="单立户账户"
                                  style={{ width: '100%', marginBottom: 10 }}
                                  {...formItemLayout}
                                >
                                  {getFieldDecorator('insAccoId', {
                                    rules: [{ required: true, message: '请选择' }],
                                  })(
                                    <Select
                                      placeholder="请选择"
                                      labelInValue
                                      showSearch
                                      optionFilterProp="children"
                                      style={{ width: 600 }}
                                      onSelect={(value, options) => {
                                        this.setInsGroupData(
                                          insLsPkgDtoList,
                                          form.getFieldValue('insPayWay')
                                            ? form.getFieldValue('insPayWay').label
                                            : '',
                                          value.label,
                                          options.props.serconinfo.plcyName
                                        );
                                      }}
                                      onFocus={() => this.getAccountList('PDINF_0000000001')}
                                    >
                                      {insAccountOL}
                                    </Select>
                                  )}
                                </FormItem>
                              ) : (
                                <FormItem
                                  label="社保组合"
                                  style={{ width: '100%', marginBottom: 10 }}
                                  {...formItemLayout}
                                >
                                  {getFieldDecorator('insGrpId', {
                                    rules: [{ required: true, message: '请选择' }],
                                  })(
                                    <Select
                                      placeholder="请选择"
                                      labelInValue
                                      showSearch
                                      optionFilterProp="children"
                                      style={{ width: 600 }}
                                      onSelect={value => {
                                        this.setInsGroupData(
                                          insLsPkgDtoList,
                                          form.getFieldValue('insPayWay')
                                            ? form.getFieldValue('insPayWay').label
                                            : '',
                                          '',
                                          value.label,
                                          secAccoName
                                        );
                                      }}
                                    >
                                      {insGroupOL}
                                    </Select>
                                  )}
                                </FormItem>
                              )}
                              {baseInfoDto.areaId === '1415662' &&
                              !isSupplyRun &&
                              insSingleAccout === '2' &&
                              isHasSerAcco ? (
                                <FormItem
                                  label="工伤二级户"
                                  style={{ width: '100%', marginBottom: 10 }}
                                  {...formItemLayout}
                                >
                                  {getFieldDecorator('injSecAccoId', {
                                    rules: [{ required: true, message: '请选择' }],
                                  })(
                                    <Cascader
                                      placeholder="请输入关键字检索"
                                      options={secAccoList}
                                      showSearch
                                      notFoundContent="暂无工伤二级户"
                                      onChange={(value, selectedOptions) =>
                                        this.selectSecAcco(value, selectedOptions)
                                      }
                                      changeOnSelect
                                      style={{ width: 600 }}
                                    />
                                  )}
                                </FormItem>
                              ) : null}
                            </div>
                          ) : null}
                          <FormItem
                            label="&nbsp;"
                            style={{ width: '100%', marginBottom: 10 }}
                            colon={false}
                            {...formItemLayout}
                          >
                            {getFieldDecorator('insGroupTable', {
                              rules: [{ required: false, message: '请选择' }],
                            })(
                              <Table
                                style={{ width: 600 }}
                                columns={insGroupColumns}
                                dataSource={insGroupData}
                                rowKey={record => record.ass}
                                bordered
                                size="middle"
                                pagination={false}
                              />
                            )}
                          </FormItem>
                        </div>
                      ) : null}
                    </Col>
                  </Row>
                </div>
              ) : null}
              {accuLsPkgFlag ? (
                <div> 
                  <Divider dashed style={{ marginBottom: 14 }} />
                  <Row>
                    <Col offset={2}>
                      <FormItem
                        label={
                          <span style={{ display: 'inline-block', width: 108 }}>公积金组合</span>
                        }
                        colon={false}
                        style={{ marginLeft: 30, marginBottom: 10 }}
                      >
                        {getFieldDecorator('isAccuLsPkgFlag', {
                          valuePropName: 'checked',
                          rules: [{ required: false, message: '请选择' }],
                          initialValue: false,
                        })(
                          <Switch
                            checkedChildren="修改"
                            unCheckedChildren="不修改"
                            style={{ width: 70 }}
                            onChange={check => this.changeSWitch(check, 'isAccuLsPkgFlag')}
                            disabled={!accuLsPkgUpdateFlag}
                          />
                        )}
                      </FormItem>
                      {isAccuLsPkgFlag && accuLsPkgUpdateFlag ? (
                        <div style={{ marginLeft: 140 }}>
                          <FormItem
                            label="服务配置"
                            style={{ width: '100%', marginBottom: 10 }}
                            {...formItemLayout}
                          >
                            {getFieldDecorator('accuSerConfigFlag', {
                              rules: [{ required: true, message: '请选择' }],
                              initialValue: accuSerConfigFlag,
                            })(
                              <RadioGroup
                                onChange={e => this.changeRadio(e, 'accuSerConfigFlag', false)}
                              >
                                {YES_NO_FLAG.map(item => (
                                  <Radio key={item.itemCode} value={item.itemCode}>
                                    {item.itemName}
                                  </Radio>
                                ))}
                              </RadioGroup>
                            )}
                          </FormItem>
                          {accuSerConfigFlag === '1' ? (
                            <FormItem
                              label="使用服务配置"
                              style={{ width: '100%', marginBottom: 10 }}
                              {...formItemLayout}
                            >
                              {getFieldDecorator('accuSerSetId', {
                                rules: [{ required: true, message: '请选择' }],
                              })(
                                <Select
                                  placeholder="请选择"
                                  labelInValue
                                  showSearch
                                  optionFilterProp="children"
                                  style={{ width: 600 }}
                                  onSelect={(value, options) =>
                                    this.selectSerConfig(value, options, 'accu')
                                  }
                                >
                                  {accuSerConfigOL}
                                </Select>
                              )}
                            </FormItem>
                          ) : null}
                          {accuSerConfigFlag === '2' ? (
                            <div>
                              <FormItem
                                label="缴费方式"
                                style={{ width: '100%', marginBottom: 10 }}
                                {...formItemLayout}
                              >
                                {getFieldDecorator('accuPayWay', {
                                  rules: [{ required: true, message: '请选择' }],
                                })(
                                  <Select
                                    placeholder="请选择"
                                    labelInValue
                                    showSearch
                                    optionFilterProp="children"
                                    style={{ width: 600 }}
                                    onSelect={value => this.selectPayWay(value, 'accuSingleAccout')}
                                  >
                                    {dictOL(accuPayWayList)}
                                  </Select>
                                )}
                              </FormItem>
                              {accuSingleAccout === '1' ? (
                                <FormItem
                                  label="单立户账户"
                                  style={{ width: '100%', marginBottom: 10 }}
                                  {...formItemLayout}
                                >
                                  {getFieldDecorator('accuAccoId', {
                                    rules: [{ required: true, message: '请选择' }],
                                  })(
                                    <Select
                                      placeholder="请选择"
                                      labelInValue
                                      showSearch
                                      optionFilterProp="children"
                                      style={{ width: 600 }}
                                      onSelect={(value, options) => {
                                        this.setAccuGroupData(
                                          form.getFieldValue('accuPayWay')
                                            ? form.getFieldValue('accuPayWay').label
                                            : '',
                                          value.label,
                                          options.props.serconinfo.plcyName
                                        );
                                      }}
                                      onFocus={() => this.getAccountList('PDINF_0000000002')}
                                    >
                                      {accuAccountOL}
                                    </Select>
                                  )}
                                </FormItem>
                              ) : (
                                <FormItem
                                  label="公积金组合"
                                  style={{ width: '100%', marginBottom: 10 }}
                                  {...formItemLayout}
                                >
                                  {getFieldDecorator('accuGrpId', {
                                    rules: [{ required: true, message: '请选择' }],
                                  })(
                                    <Select
                                      placeholder="请选择"
                                      labelInValue
                                      showSearch
                                      optionFilterProp="children"
                                      style={{ width: 600 }}
                                      onSelect={value => {
                                        this.setAccuGroupData(
                                          form.getFieldValue('accuPayWay')
                                            ? form.getFieldValue('accuPayWay').label
                                            : '',
                                          '',
                                          value.label
                                        );
                                      }}
                                    >
                                      {accuGroupOL}
                                    </Select>
                                  )}
                                </FormItem>
                              )}
                            </div>
                          ) : null}
                          <FormItem
                            label="&nbsp;"
                            style={{ width: '100%', marginBottom: 10 }}
                            colon={false}
                            {...formItemLayout}
                          >
                            {getFieldDecorator('accuGroupTable', {
                              rules: [{ required: false, message: '请选择' }],
                            })(
                              <Table
                                style={{ width: 600 }}
                                columns={accuGroupColumns}
                                dataSource={accuGroupData}
                                rowKey={record => record.ass}
                                bordered
                                size="middle"
                                pagination={false}
                              />
                            )}
                          </FormItem>
                        </div>
                      ) : null}
                    </Col>
                  </Row>
                </div>
              ) : null}
            </Card>
            <Card 
              className={styles.labelStyleRight}
              title={<span style={{ fontWeight: 'bolder' }}>合同信息</span>}
            >
              {insIdeFlag ? (
                <div>
                  <Row>
                    <Col offset={2}>
                      <FormItem
                        label={
                          <span style={{ display: 'inline-block', width: 108 }}>合同信息</span>
                        }
                        colon={false}
                        style={{ marginLeft: 30 }}
                      >
                        {getFieldDecorator('isPactFlag', {
                          valuePropName: 'checked',
                          rules: [{ required: false, message: '请选择' }],
                          initialValue: false,
                        })(
                          <Switch
                            checkedChildren="修改"
                            unCheckedChildren="不修改"
                            style={{ width: 70 }}
                            onChange={check => this.changeSWitch(check, 'isPactFlag')}
                            disabled={!sendContUpdateFlag}
                          />
                        )}
                      </FormItem>

                      {isPactFlag && laborCont && laborCont.serType === 1 ? (
                        <div style={{ marginLeft: 140 }}>
                          {/* {laborCont.signDate ? ( */}
                          <FormItem
                            label="合同签订日期" 
                            {...formItemLayout}
                          >
                            {getFieldDecorator('laborCont.signDate', {
                              rules: [{ required: baseInfoDto && baseInfoDto.areaId && +baseInfoDto.accuCityId===752252, message: '请选择' }],
                              initialValue: laborCont.signDate? moment(laborCont.signDate): null,
                            })(
                              <DatePicker
                                placeholder="请选择"
                                style={{ width: 600 }}
                                // allowClear={false} 
                                format="YYYY-MM-DD"
                              />
                            )}
                          </FormItem>
                          {/* ): null} */}

                          {/* {laborCont.electrSignFlag ? ( */}
                          <FormItem label="是否已签订电子劳动合同" {...formItemLayout}>
                            {getFieldDecorator('laborCont.electrSignFlag', {
                              rules: [{ required: baseInfoDto && baseInfoDto.areaId && +baseInfoDto.accuCityId===752252, message: '请选择' }],
                              initialValue: laborCont.electrSignFlag ? `${laborCont.electrSignFlag}` : '',
                            })(<DictCode dictType="YES_NO_FLAG" style={{ width: 600 }} />)}
                          </FormItem>
                          {/* ) : null}  */}

                          {/* {laborCont.wkJob ? ( */}
                          
                          <FormItem
                            label="岗位"
                            {...formItemLayout}                  
                          >
                            {getFieldDecorator('laborCont.wkJob', {
                        rules: [{ required: baseInfoDto && baseInfoDto.areaId && +baseInfoDto.accuCityId===752252, message: '最多不超过50字符', max: 50 }],
                        initialValue: laborCont.wkJob
                      })(<Input placeholder="请输入" style={{ width: 600 }} />)}
                          </FormItem>
                          {/* ) : null} */}

                          {/* {laborCont.fixedDeadlnFlag ? ( */}
                          <FormItem label="有无固定期限" {...formItemLayout}>
                            {getFieldDecorator('laborCont.fixedDeadlnFlag', {
                                  rules: [{ required: baseInfoDto && baseInfoDto.areaId && +baseInfoDto.accuCityId===752252, message: '请选择' }],
                                  initialValue: `${laborCont.fixedDeadlnFlag}`
                                })(
                                  <DictCode
                                    dictType="ISNULL_FLAG"
                                    onSelect={this.selectContFixedDate}
                                    style={{ width: 600 }}
                                  />
                                )}
                          </FormItem>
                          {/* ) : null} */}

                          {/* {laborCont.contBeginDate ? ( */}
                          <FormItem label="合同开始日期" {...formItemLayout}>
                            {getFieldDecorator('laborCont.contBeginDate', {
                                rules: [{ required: baseInfoDto && baseInfoDto.areaId && +baseInfoDto.accuCityId===752252, message: '请选择' }],
                                initialValue: laborCont.contBeginDate? moment(laborCont.contBeginDate) : null
                              })(
                                <DatePicker
                                  style={{ width: 600 }}
                                  format="YYYY-MM-DD"
                                  disabledDate={current => this.disabledStarDate(current, 'laborCont.contEndDate')}
                                  placeholder="请选择"
                                />
                              )}
                          </FormItem>
                          {/* ) : null} */}

                          
                          {/* {laborCont.fixedDeadlnFlag  ? ( */}
                          <FormItem label="合同结束日期" {...formItemLayout}>
                            {getFieldDecorator('laborCont.contEndDate', {
                                  rules: [{ required: isContEndRequired, message: '请选择' }],
                                  initialValue: laborCont.contEndDate? moment(laborCont.contEndDate) : null
                                })(
                                  <DatePicker
                                    placeholder="请选择"
                                    format="YYYY-MM-DD"
                                    disabled={!isContEndRequired}
                                    disabledDate={current => this.disabledEndDate(current, 'laborCont.contBeginDate')}
                                    style={{ width: 600 }}
                                  />
                                )}
                          </FormItem>
                          {/* ) : null} */}

                          {/* {laborCont.contWage ? ( */}
                          <FormItem label="合同期劳动报酬" {...formItemLayout}>
                            {getFieldDecorator('laborCont.contWage', {
                            rules: [
                              {
                                required: baseInfoDto && baseInfoDto.areaId && +baseInfoDto.accuCityId===752252,
                                message: '请输入小数点不超过2位的数字',
                                pattern: /^-?\d+\.?\d{0,2}$/,
                              },
                            ],
                            initialValue: laborCont.contWage
                          })(
                            <InputNumber
                              min={0}
                              max={9999999.99}
                              placeholder="请输入"
                              style={{ width: 600 }}

                            />
                          )}
                          </FormItem>
                          {/* ) : null} */}
                        </div>
                      ): null}

                      {isPactFlag && laborCont && +laborCont.serType !== 1? (
                        <div style={{ marginLeft: 140 }}>
                          {laborCont.contSignWay ? (
                            <FormItem label="合同签署方式" {...formItemLayout}>
                              {getFieldDecorator('laborCont.contSignWay', {
                                rules: [{ required: true, message: '请选择' }],
                                initialValue: laborCont.contSignWay,
                              })(<DictCode dictType="CONT_SIGN_WAY" style={{ width: 600 }} />)}
                            </FormItem>
                            ) : null}
                          
                          {laborCont.contType ? (
                            <FormItem label="合同类型" {...formItemLayout}>
                              {getFieldDecorator('laborCont.contType', {
                                rules: [{ required: false, message: '请选择' }],
                                initialValue: laborCont.contType ? `${laborCont.contType}` : '',
                              })(<DictCode dictType="EMP_CONT_TYPE" style={{ width: 600 }} disabled={!insIdeUpdateFlag} />)}
                            </FormItem>
                              ) : null}

                          {laborCont.signDate ? (
                            <FormItem label="合同签订日期" {...formItemLayout}>
                              {getFieldDecorator('laborCont.signDate', {
                              rules: [{ required: baseInfoDto && baseInfoDto.areaId && +baseInfoDto.accuCityId===752252, message: '请选择' }],
                              initialValue: laborCont.signDate? moment(laborCont.signDate): null,
                            })(
                              <DatePicker
                                placeholder="请选择"
                                style={{ width: 600 }}
                                // allowClear={false} 
                                format="YYYY-MM-DD"
                              />
                            )}
                            </FormItem>
                          ): null}
                              
                          {laborCont.electrSignFlag ? (
                            <FormItem label="是否已签订电子劳动合同" {...formItemLayout}>
                              {getFieldDecorator('laborCont.electrSignFlag', {
                              rules: [{ required: baseInfoDto && baseInfoDto.areaId && +baseInfoDto.accuCityId===752252, message: '请选择' }],
                              initialValue: `${laborCont.electrSignFlag}` || '',
                            })(<DictCode dictType="YES_NO_FLAG" style={{ width: 600 }} />)}
                            </FormItem>
                         ) : null} 

                          {laborCont.wkJob ? (
                          
                            <FormItem label="岗位" {...formItemLayout}>
                              {getFieldDecorator('laborCont.wkJob', {
                          rules: [{ required: baseInfoDto && baseInfoDto.areaId && +baseInfoDto.accuCityId===752252, message: '最多不超过50字符', max: 50 }],
                          initialValue: laborCont.wkJob
                        })(<Input placeholder="请输入" style={{ width: 600 }} />)}
                            </FormItem>
                      ) : null}

                          {laborCont.contNo ? (
                            <FormItem label="合同编号" {...formItemLayout}>
                              {getFieldDecorator('laborCont.contNo', {
                                rules: [
                                  {
                                    required: false,
                                    message: '数字与字母组合且最大长度不超过20',
                                    pattern: /^[A-Za-z0-9]{1,20}$/,
                                    max: 20,
                                  },
                                ],
                                initialValue: laborCont.contNo,
                              })(<Input placeholder="请输入" style={{ width: 600 }} disabled={!insIdeUpdateFlag} />)}
                            </FormItem>
                            ) : null}

                          {laborCont.fixedDeadlnFlag ? (
                            <FormItem label="有无固定期限" {...formItemLayout}>
                              {getFieldDecorator('laborCont.fixedDeadlnFlag', {
                                  rules: [{ required: baseInfoDto && baseInfoDto.areaId && +baseInfoDto.accuCityId===752252, message: '请选择' }],
                                  initialValue: `${laborCont.fixedDeadlnFlag}`
                                })(
                                  <DictCode
                                    dictType="ISNULL_FLAG"
                                    onSelect={this.selectContFixedDate}
                                    style={{ width: 600 }}
                                  />
                                )}
                            </FormItem>
                            ) : null}

                          {laborCont.contBeginDate ? (
                            <FormItem label="合同开始日期" {...formItemLayout}>
                              {getFieldDecorator('laborCont.contBeginDate', {
                                rules: [{ required: baseInfoDto && baseInfoDto.areaId && +baseInfoDto.accuCityId===752252, message: '请选择' }],
                                initialValue: laborCont.contBeginDate? moment(laborCont.contBeginDate) : null
                              })(
                                <DatePicker
                                  style={{ width: 600 }}
                                  format="YYYY-MM-DD"
                                  disabledDate={current => this.disabledStarDate(current, 'laborCont.contEndDate')}
                                  placeholder="请选择"
                                />
                              )}
                            </FormItem>
                            ) : null}

                          {laborCont.fixedDeadlnFlag  ? (
                            <FormItem label="合同结束日期" {...formItemLayout}>
                              {getFieldDecorator('laborCont.contEndDate', {
                                  rules: [{ required: isContEndRequired, message: '请选择' }],
                                  initialValue: laborCont.contEndDate? moment(laborCont.contEndDate) : null
                                })(
                                  <DatePicker
                                    placeholder="请选择"
                                    format="YYYY-MM-DD"
                                    disabledDate={current => this.disabledEndDate(current, 'laborCont.contBeginDate')}
                                    disabled={!isContEndRequired}
                                    style={{ width: 600 }}
                                  />
                                )}
                            </FormItem>
                         ) : null}

                          {laborCont.probtnFlag ? (
                            <FormItem label="有无试用期" {...formItemLayout}>
                              {getFieldDecorator('laborCont.probtnFlag', {
                                rules: [{ required: false, message: '请选择' }],
                                initialValue: `${laborCont.probtnFlag}`
                              })(
                                <DictCode
                                  dictType="ISNULL_FLAG"
                                  onSelect={this.selectContTryDate}
                                  style={{ width: 600 }}
                                />
                              )}
                            </FormItem>
                          ) : null}

                          {laborCont.probtnFlag ? (
                            <FormItem label="试用期开始日期" {...formItemLayout}>
                              {getFieldDecorator('laborCont.probtnBeginDate', {
                            rules: [{ required: false, message: '请选择' }],
                            initialValue: laborCont.probtnBeginDate? moment(laborCont.probtnBeginDate) : null
                          })(
                            <DatePicker
                              placeholder="请选择"
                              format="YYYY-MM-DD"
                              style={{ width: 600 }}
                              disabledDate={current => this.disabledStarDate(current, 'laborCont.probtnEndDate')}
                              disabled={!isTryDateRequired}
                            />
                          )}
                            </FormItem>
                          ) : null}

                          {laborCont.probtnFlag ? (
                            <FormItem label="试用期结束日期" {...formItemLayout}>
                              {getFieldDecorator('laborCont.probtnEndDate', {
                            rules: [{ required: false, message: '请选择' }],
                            initialValue: laborCont.probtnEndDate? moment(laborCont.probtnEndDate) : null
                          })(
                            <DatePicker
                              placeholder="请选择"
                              format="YYYY-MM-DD"
                              disabledDate={current => this.disabledStarDate(current, 'laborCont.probtnBeginDate')}
                              disabled={!isTryDateRequired}
                              style={{ width: 600 }}

                            />
                          )}
                            </FormItem>
                          ) : null}

                          {laborCont.contWage ? (
                            <FormItem label="合同期劳动报酬" {...formItemLayout}>
                              {getFieldDecorator('laborCont.contWage', {
                            rules: [
                              {
                                required: baseInfoDto && baseInfoDto.areaId && +baseInfoDto.accuCityId===752252,
                                message: '请输入小数点不超过2位的数字',
                                pattern: /^-?\d+\.?\d{0,2}$/,
                              },
                            ],
                            initialValue: laborCont.contWage
                          })(
                            <InputNumber
                              min={0}
                              max={9999999.99}
                              placeholder="请输入"
                              style={{ width: 600 }}

                            />
                          )}
                            </FormItem>
                        ) : null}

                          {laborCont.probtnFlag ? (
                            <FormItem label="试用期劳动报酬" {...formItemLayout}>
                              {getFieldDecorator('laborCont.probtnWage', {
                            rules: [
                              {
                                required: false,
                                message: '请输入小数点不超过2位的数字',
                                pattern: /^-?\d+\.?\d{0,2}$/,
                              },
                            ],
                            initialValue: laborCont.probtnWage
                          })(
                            <InputNumber
                              min={0}
                              max={9999999.99}
                              placeholder="请输入"
                              style={{ width: 600 }}
                              disabled={!isTryDateRequired}
                            />
                          )}
                            </FormItem>
                          ) : null}


                          {laborCont.laborHour ? (
                            <FormItem label="工时" {...formItemLayout}>
                              {getFieldDecorator('laborCont.laborHour', {
                            rules: [{ required: false, message: '请选择' }],
                            initialValue: laborCont.laborHour ? `${laborCont.laborHour}` : ''
                          })(<DictCode dictType="WORK_HOURS" style={{ width: 600 }} />)}
                            </FormItem>
                        ) : null}

                         

                          {laborCont.wkLoc ? (
                            <FormItem label="工作地点" {...formItemLayout}>
                              {getFieldDecorator('laborCont.wkLoc', {
                            rules: [{ required: false, message: '最多不超过100字符', max: 100 }],
                            initialValue: laborCont.wkLoc
                          })(<Input placeholder="请输入" style={{ width: 600 }} />)}
                            </FormItem>
                        ) : null}

                          {laborCont.wkContent ? (
                            
                            <FormItem label="工作内容" {...formItemLayout}>
                              {getFieldDecorator('laborCont.wkContent', {
                            rules: [{ required: false, message: '最多不超过100字符', max: 100 }],
                            initialValue: laborCont.wkContent
                          })(<Input placeholder="请输入" style={{ width: 600 }} />)}
                            </FormItem>
                        ) : null}

                          {laborCont.entryMedExamFlag ? (
                            <FormItem label="是否做入职体检" {...formItemLayout}>
                              {getFieldDecorator('laborCont.entryMedExamFlag', {
                            rules: [{ required: false, message: '请选择' }],
                            initialValue: laborCont.entryMedExamFlag
                          })(<DictCode dictType="YES_NO_FLAG" style={{ width: 600 }} />)}
                            </FormItem>
                        ) : null}
                        </div>
                      ): null}
                    </Col>
                  </Row>
                </div>
              ) : null}
            </Card>
            <Card title={<span style={{ fontWeight: 'bolder' }}>办理备注</span>}>
              <Row className={styles.addempRemark}>
                <Col style={{ width: '100%' }}>
                  <FormItem label="备注" style={{ width: '100%' }} {...formItemLayoutRemark}>
                    {getFieldDecorator('remark', {
                      rules: [{ required: false, message: '请输入' }],
                      initialValue: undefined,
                    })(
                      <TextArea
                        rows={4}
                        maxLength={200}
                        placeholder="请输入"
                        onChange={this.changeRemark}
                      />
                    )}
                  </FormItem>
                </Col>
              </Row>
            </Card>
            <FooterToolbar style={{ width: '100%' }}>
              <Button onClick={() => window.history.back()} style={{ marginRight: 10 }}>
                取消
              </Button>
              <Button type="primary" onClick={this.sumSubmit} disabled={!isEdit}>
                提交
              </Button>
            </FooterToolbar>
          </Form>
        </Spin>
      </PageHeaderWrapper>
    );
  }
}
const BasicFormList = Form.create()(BasicForm);
export default BasicFormList;
